with open('announce.txt', 'rb') as f:
    content = f.read().decode('utf-8')


regions = content.split('\n\n')

w = open('announce.html', 'wb')


def write(s):
    w.write(s.encode('utf-8'))
    w.write(b'\n')


for region in regions:
    region = region.split('\n')

    header = region[0]
    remain = region[1:]

    write('<h4>{}</h4>'.format(header))
    write('<ul>')
    for item in remain:
        if len(item.strip()):
            write('<li>{}</li>'.format(item))
    write('</ul>')

w.close()
